{extend name="public/base" /}
{block name="style"}<link href="__LIB__/fileinput/css/fileinput.min.css" rel="stylesheet" /> {/block}
 {block name="body"}
 <div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">竞价拍卖</a>
		</li>
		<li><strong>添加拍卖</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('add')}">
					<div class="form-group">
						<label class="col-sm-3 control-label">商品标题：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="title" name="title"  class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">商品图片：</label>
						<div class="input-group col-sm-4">
							<input type="hidden" id="thumb" name="thumb" />
							<input id="upload" name="upload" type="file" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">市场价格：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="market_price" name="market_price" class="form-control" />
							（商品原价值，不得高于1w元）
						</div>
					</div>					
					<div class="form-group">
						<label class="col-sm-3 control-label">起拍价格：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="pai_price" name="pai_price"  class="form-control" />
							（拍卖初始价格，不得高于市场价格）
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">竞价阶梯：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="add_price" name="add_price"  class="form-control" />
							 （拍卖每次固定加价金额，不得高于市场价格的1/10）
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">保证金：</label>
						<div class="input-group col-sm-4">
							<input type="text" id="deposit" name="deposit" class="form-control" />
							（参加拍卖的保证金，防止恶意拍价，不得高于市场价格）
						</div>
					</div>
			      	<div class="form-group">
						<label class="col-sm-3 control-label">活动起止时间：</label>
						<div class="input-group col-sm-5">
							<input id='start_time' name='start_time'  style="width: 220px;" onclick="WdatePicker({dateFmt:'yyyy-M-d HH:mm:00'})" type='text' placeholder="开始时间" class="form-control layer-date" />
							<input id='end_time' name='end_time'  style="width: 220px;" onclick="WdatePicker({dateFmt:'yyyy-M-d HH:mm:00'})" type='text' placeholder="结束时间" class="form-control layer-date" />				
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">拍卖商品详情：</label>
						<div class="input-group col-sm-6">
							<textarea id="content" name="content" style="height: 400px;"></textarea>
						</div>
					</div>
					<div class="hr-line-dashed"></div>
					<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
							<a href="{:url('index')}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> 返回 </a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__LIB__/ueditor/ueditor.all.js" type="text/javascript"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	var ueditor = UE.getEditor('content');
	upload_one('__IMG__/default.jpg');
	$(function() {
		$("#myForm").validate({
			rules: {
				title: "required",
				market_price: "required",
				pai_price: "required",
				add_price: "required",
				deposit: "required"
				
				
			},
			messages: {
				title: ICON.error + "请输入标题",
				market_price: ICON.error + "请输市场价格",
				pai_price: ICON.error + "请输起拍价格",
				add_price: ICON.error + "请输竞价阶梯",
				deposit: ICON.error + "请输保证金"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
{/block}